package nl.blindwars.mapeditor.gui;

import java.awt.Cursor;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;


public class MenuPanel extends MyJPanel implements ActionListener {
	private static final long serialVersionUID = 4539372124501529635L;

	Window window;
	
	JButton drawBorderBtn;
	
	public MenuPanel(Window window, int width, int height) {
		super();

		this.window = window;
		
		setSize(width, height);
		
		init();
	}
	
	private void init() {
		setLayout(new GridLayout(8,2));
		addButtons();
		setOpaque(true);
	}
	
	/**
	 * Create and add the buttons to the panel.
	 * @TODO: Replace text labels with icons.
	 */
	private void addButtons() {
		drawBorderBtn = new JButton("Draw border");
		drawBorderBtn.addActionListener(this);
		add(drawBorderBtn);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == drawBorderBtn) {
			window.toggleDrawMode();
		}
	}
}
